package com.tjx.service.impl;

import com.tjx.entity.TicketVisitor;
import com.tjx.mapper.TicketVisitorMapper;
import com.tjx.service.ITicketVisitorService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 票-游客信息表 服务实现类
 * </p>
 *
 * @author tjx
 * @since 2025-10-29
 */
@Service
public class TicketVisitorServiceImpl extends ServiceImpl<TicketVisitorMapper, TicketVisitor> implements ITicketVisitorService {
    @Autowired
    private TicketVisitorMapper ticketVisitorMapper;



        // 新增票-游客关联服务
        @Override
        public Integer addTicketVisitor(List<TicketVisitor> ticketVisitors) {
            if(ticketVisitors.isEmpty()){
                return 0;
            }
            // 插入票-游客关联记录到数据库
            ticketVisitorMapper.insertBatch(ticketVisitors);
            return ticketVisitors.size();
        }

}
